-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(selection-list): highlight on lists with 1 section #27246
fix(selection-list): highlight on lists with 1 section #27246
Conversation
@shawnborton @allroundexperts One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Pinging @Santhosh-Sellavel here because he reviewed all the other SelectionList refactor PRs |
@thiagobrez @Santhosh-Sellavel is OoO. I can help the review here! |
Awesome, thank you @allroundexperts! For context: Shawn said here to change to this behavior |
Sounds good! |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-25.at.9.50.59.AM.movMobile Web - ChromeScreen.Recording.2023-09-25.at.9.52.37.AM.movMobile Web - SafariScreen.Recording.2023-09-25.at.9.57.39.AM.movDesktopScreen.Recording.2023-09-25.at.10.01.00.AM.moviOSScreen.Recording.2023-09-25.at.9.58.31.AM.movAndroidScreen.Recording.2023-09-25.at.9.56.07.AM.mov |
Looks good to me, thanks! |
@thiagobrez The item remains highlighted even if you un-select it. Can you please check? Screen.Recording.2023-09-13.at.2.44.41.AM.mov |
Hey @allroundexperts, what is the expected behavior though? |
I'm not sure. But this does not look right. If you've unselected the row, the highlight should not stick. If you can confirm that this is expected, then I can continue with the review. |
I got you, this is new behavior and I don't have enough information to answer that. We'll need @shawnborton to check this |
Yeah, the only highlight we want to remain is the highlight used when moving around with the arrow keys. The highlight indicates what row is active in terms of arrow navigation. And we decided that it is weird that if you check or uncheck a row that your active row would change. Basically you should not lose position of your active row as you toggle things on or off if you are using the arrow keys. So I think @allroundexperts is right above. |
Ok, so if I understand correct, while you're navigating with the keyboard, either activating or deactivating you should never loose the active row. The problem currently is when clicking/pressing. If I click to activate, the row should get highlighted. If I click to deactivate, the highlight should disappear. Is that how it should behave ⬆️ ? |
I think that makes sense. Although, how does click to highlight work today? |
…:thiagobrez/expensify into thiagobrez/selection-list-highlight-jump
@shawnborton @allroundexperts I understand the source of confunsion now. When clicking the item, it was showing an "active" highlight, same as if you were hovering it, which is not the same as the highlight for when you're moving with the arrow keys. I removed that, which fixes what @allroundexperts mentioned above, and makes it much cleaner. Also included in the commit a fix for the Enter hotkey event, which was not working as expected when we had accessibility selection active. Here's a video in action: Screen.Recording.2023-09-14.at.16.21.39.mov |
That looks perfect, thanks! |
@allroundexperts Friendly reminder here |
On it now! |
This is still not working as intended. At the end of this video, notice that selecting a new row does not unselect the old one. Screen.Recording.2023-09-20.at.12.41.09.AM.movScreen.Recording.2023-09-20.at.12.43.58.AM.mov |
@allroundexperts Ok - sent fixes, please review again! |
Heads up: I'll be OOO from tomorrow until Tuesday - if needed, someone from Callstack can continue here! |
* @param {Object} item - the list item | ||
* @param {Boolean} shouldUnfocusRow - flag to decide if we should unfocus all rows. True when selecting a row with click or press (not keyboard) | ||
*/ | ||
const selectRow = (item, shouldUnfocusRow = false) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why defaulting shouldUnfocusRow
to false
when the callers always have true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allroundexperts The callers that pass true
are the press handlers. Please search for the keyboard subscriber - there selectRow
is used without the second parameter, which defaults to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/cristipaval in version: 1.3.75-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.75-12 🚀
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
Details
On lists with only 1 section, after selecting one item in the list, the next available item was being focused.
Simplified the logic to do nothing in this case.
Fixed Issues
$ #25884
PROPOSAL:
Tests
In Workspace -> Members (multiple-selection list with only 1 section):
In Workspace -> Members -> Invite (multiple-selection list with multiple sections), nothing is changed. Selected items are moved to the top, and highlight goes to the first un-selected item.
Offline tests
QA Steps
In Workspace -> Members (multiple-selection list with only 1 section):
In Workspace -> Members -> Invite (multiple-selection list with multiple sections), nothing is changed. Selected items are moved to the top, and highlight goes to the first un-selected item.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
android.web.mov
Mobile Web - Safari
ios.web.mp4
Desktop
desktop.mov
iOS
ios.native.mp4
Android
android.native.mov